// gfx/VisualText.h

#ifndef _GFX_VisualText_H_
#define _GFX_VisualText_H_

#ifndef _CORE_std_H_
#include <core/std.h>
#endif

#ifndef _GFX_Visual_H_
#include <gfx/Visual.h>
#endif

namespace FONT
{
	class BMFont;
};

namespace GFX
{

class VisualText : public Visual
{
public:
	enum EHAlign
	{
		E_HALIGN_LEFT = 0,
		E_HALIGN_CENTRE,
		E_HALIGN_RIGHT,

		E_HALIGN_COUNT
	};

	enum EVAlign
	{
		E_VALIGN_TOP = 0,
		E_VALIGN_CENTRE,
		E_VALIGN_BOTTOM,
		E_VALIGN_BASELINE,

		E_VALIGN_COUNT
	};

	VisualText() : m_pFont(0),
		m_pText(0),
		m_fWidth(0.0f),
		m_fHeight(0.0f),
		m_eHAlign(E_HALIGN_CENTRE),
		m_eVAlign(E_VALIGN_CENTRE) {}
	virtual ~VisualText()
	{;};

	virtual TypeId				GetTypeId() {
		return s_TypeId;
	}
	static TypeId				StaticTypeId() {
		return s_TypeId;
	}

	void						SetVisualText(FONT::BMFont *pFont, wchar_t * pText);

	// Accessor
	float32_t					GetWidth() const {
		return m_fWidth;
	}
	float32_t					GetHeight() const {
		return m_fHeight;
	}

	EHAlign						GetHAlign() const {
		return m_eHAlign;
	}
	EVAlign						GetVAlign() const {
		return m_eVAlign;
	}
	void						SetAlignment(EHAlign eHAlign, EVAlign eVAlign) {
		m_eHAlign = eHAlign;
		m_eVAlign = eVAlign;
	}

	const FONT::BMFont *		GetFont() const {
		return m_pFont;
	}
	const wchar_t *				GetText() const {
		return m_pText;
	}
	void						SetText(wchar_t * pText) {
		m_pText = pText;
	}

	const CORE::Colour &		GetColour() const {
		return m_Colour;
	}
	void						SetColour(const CORE::Colour & colColour) {
		m_Colour = colColour;
	}

	// APIs

protected:

	static TypeId		s_TypeId;

	CORE::Colour		m_Colour;
	FONT::BMFont *		m_pFont;
	wchar_t *			m_pText;
	float32_t			m_fWidth, m_fHeight;

	EHAlign				m_eHAlign;
	EVAlign				m_eVAlign;
}; // class VisualText

}; // namespace GFX

#endif